package com.itbac;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author: BacHe
 * @email: 1218585258@qq.com
 * @Date: 2021/4/19 23:49
 */
@SpringBootApplication
//nacos客户端
@EnableDiscoveryClient
//开启Feign
@EnableFeignClients
public class OrderApplication {
    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class);
    }

    @Bean
    @LoadBalanced //ribbo 负载均衡, 加注解和不加，restTemplate的调用方式不能兼容。
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
